#ifndef TEMPLATEPLUGIN_H
#define TEMPLATEPLUGIN_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlTableModel>
#include <QActionGroup>

class templatePlugin : public QObject
{
    Q_OBJECT
public:
    explicit templatePlugin(int tourId = 0, QObject *parent = 0);
    virtual void pluginInfo(QString &vrvs_name, QString &vrvs_code, QString &plug_version); //!< @brief Get plugin info
    virtual bool testDatabaseStructure(QSqlDatabase *);                                     //!< @brief Test plugin dbatabase structure
    virtual bool buildDatabase(QSqlDatabase*);                                              //!< @brief Build plugin database
    QActionGroup *menuTour();                                                               //!< @brief Return action list for tour menu
    void setTour(int tourId);                                                               //!< @brief set pointer to current competition tour
    int tour();

signals:
    void activated();               //!< plugin was activated
    void closed();                  //!< plugin was closed
    void dataCommited();            //!< plugin commit data to database

public slots:
    void setActive(bool);           //!< set plugin activite state
    bool isActive();                //!< get plugin status

private:
    bool flag_activ;
    int _tour;
    QSqlTableModel *modelStartReport;                                                       //!< Start report model
    QSqlTableModel *modelFinishReport;                                                      //!< Finish report model
};

#endif // TEMPLATEPLUGIN_H
